<?php

function conectarse() {
    $user = 'postgres';
    $passwd = '12345';
    $db = 'db_escalafon1';
    $port = 5432;
    $host = 'localhost';
    $strCnx = "host= $host port=$port dbname=$db user=$user password=$passwd";
    try {
        if (!($conexion = pg_connect($strCnx))) {
            exit();
            echo "No se Puede Conectar a DB";
        }
        return $conexion;
    } catch (SQLiteException $exc) {       
        echo "Error en DB".pg_last_error();
    }
}
?>
